<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <input type="text" v-model="date">
    <div>{{date | formdate("yyyy-MM-dd")}}</div>
  </div>
  <script src="../js/vue.js"></script>
  <script>
    const vm = new Vue({
      "el": "#app",
      "data": {
        "date": new Date()
      },
      "methods": {},
      "directives": {},
      "computed": {},
      "watch": {},
      "filters": {
        formdate(value, ...arg) {
          if (arg[0] === "yyyy-MM-dd") {
            return `${value.getFullYear()}-${value.getMonth() + 1}-${value.getDate()}`;
          };
        }
      }
    });
  </script>
</body>

</html>